<?php
//error_reporting(E_ERROR|E_PARSE);
session_start();
if($_SESSION["islogin"]!=='igiveyouthepower'){
echo "<script language=JavaScript>\r\n";
echo "alert('请先登录!');\r\n";
echo "location.href='../index.php'\r\n";
echo "</script>";
}else{
require_once('../config.php');
$conn = mysqli_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname);

$id=intval($_GET["id"]);
if($_POST['id']<>''){$ID_Dele=implode(",",$_POST['id']);}
$bname=$_REQUEST["bname"];
$lang=$_REQUEST["lang"];
if($ID_Dele<>''){
$sql = "delete from ph_".$lang." where id in(".$ID_Dele.")";
mysqli_query($conn,$sql);
if($lang=='products'){
mysqli_query($conn,"delete from ph_en where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_de where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_fr where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_it where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_es where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ja where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_th where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_da where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ky where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ta where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_nl where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_fa where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_pt where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ro where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_pl where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_hu where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_no where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_is where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ne where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_lt where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_bg where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_lo where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_be where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_vi where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_iw where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_la where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_my where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ga where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_fi where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_uk where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_mn where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_tl where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_id where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ar where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ru where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_hi where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_tr where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_sv where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ms where id in(".$ID_Dele.")");
mysqli_query($conn,"delete from ph_ca where id in(".$ID_Dele.")");
$sqlc = "delete from ph_shuxing where proid in(".$ID_Dele.")";
mysqli_query($conn,$sqlc);
$result=mysqli_query($conn,"select imgid from ph_proimg where proid in(".$ID_Dele.")");
while($row=mysqli_fetch_array($result)){
$sqls = "delete from ph_img where id ='".$row["imgid"]."'";
mysqli_query($conn,$sqls);
}
//
$sqlg = "delete from ph_proimg where proid in(".$ID_Dele.")";
mysqli_query($conn,$sqlg);
}}
if($id<>''){
$sql = "delete from ph_".$lang." where id ='".$id."'";
mysqli_query($conn,$sql);
if($lang=='products'){
mysqli_query($conn,"delete from ph_en where id ='".$id."'");
mysqli_query($conn,"delete from ph_de where id ='".$id."'");
mysqli_query($conn,"delete from ph_fr where id ='".$id."'");
mysqli_query($conn,"delete from ph_it where id ='".$id."'");
mysqli_query($conn,"delete from ph_es where id ='".$id."'");
mysqli_query($conn,"delete from ph_ja where id ='".$id."'");
mysqli_query($conn,"delete from ph_th where id ='".$id."'");
mysqli_query($conn,"delete from ph_da where id ='".$id."'");
mysqli_query($conn,"delete from ph_ky where id ='".$id."'");
mysqli_query($conn,"delete from ph_ta where id ='".$id."'");
mysqli_query($conn,"delete from ph_nl where id ='".$id."'");
mysqli_query($conn,"delete from ph_fa where id ='".$id."'");
mysqli_query($conn,"delete from ph_pt where id ='".$id."'");
mysqli_query($conn,"delete from ph_ro where id ='".$id."'");
mysqli_query($conn,"delete from ph_pl where id ='".$id."'");
mysqli_query($conn,"delete from ph_hu where id ='".$id."'");
mysqli_query($conn,"delete from ph_no where id ='".$id."'");
mysqli_query($conn,"delete from ph_is where id ='".$id."'");
mysqli_query($conn,"delete from ph_ne where id ='".$id."'");
mysqli_query($conn,"delete from ph_lt where id ='".$id."'");
mysqli_query($conn,"delete from ph_bg where id ='".$id."'");
mysqli_query($conn,"delete from ph_lo where id ='".$id."'");
mysqli_query($conn,"delete from ph_be where id ='".$id."'");
mysqli_query($conn,"delete from ph_vi where id ='".$id."'");
mysqli_query($conn,"delete from ph_iw where id ='".$id."'");
mysqli_query($conn,"delete from ph_la where id ='".$id."'");
mysqli_query($conn,"delete from ph_my where id ='".$id."'");
mysqli_query($conn,"delete from ph_ga where id ='".$id."'");
mysqli_query($conn,"delete from ph_fi where id ='".$id."'");
mysqli_query($conn,"delete from ph_uk where id ='".$id."'");
mysqli_query($conn,"delete from ph_mn where id ='".$id."'");
mysqli_query($conn,"delete from ph_tl where id ='".$id."'");
mysqli_query($conn,"delete from ph_id where id ='".$id."'");
mysqli_query($conn,"delete from ph_ar where id ='".$id."'");
mysqli_query($conn,"delete from ph_ru where id ='".$id."'");
mysqli_query($conn,"delete from ph_hi where id ='".$id."'");
mysqli_query($conn,"delete from ph_tr where id ='".$id."'");
mysqli_query($conn,"delete from ph_sv where id ='".$id."'");
mysqli_query($conn,"delete from ph_ms where id ='".$id."'");
mysqli_query($conn,"delete from ph_ca where id ='".$id."'");

$sqlc = "delete from ph_shuxing where proid='".$id."'";
mysqli_query($conn,$sqlc);

$result=mysqli_query($conn,"select imgid from ph_proimg where proid ='".$id."'");
while($row=mysqli_fetch_array($result)){
$sqls = "delete from ph_img where id ='".$row["imgid"]."'";
mysqli_query($conn,$sqls);
}
$sqlg = "delete from ph_proimg where proid ='".$id."'";
mysqli_query($conn,$sqlg);
}}
echo "<script language=JavaScript>\r\n";
echo "location.href='". $_SERVER["HTTP_REFERER"]."'\r\n";
echo "</script>";
}
?>